﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demo
{
    class Program
    {
        static void Main(string[] args)
        {
            int iSum = 0;                               //记录每次累加后的结果
            for (int iNum = 1; iNum <= 100; iNum++)
            {
                iSum += iNum;                           //把每次的iNum的值累加到上次累加的结果中
            }
            Console.WriteLine("1到100的累加结果是：" + iSum);   //输出结果
            Console.ReadLine();
        }
    }
}
